-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: make RST files conform to pandas token usage #37393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's standardize but a) need a precommit / code-check rules for this, and it should be pandas
(double-backticks)
@@ -616,7 +616,7 @@ be added with blank lines before and after them. | |||
|
|||
The way to present examples is as follows: | |||
|
|||
1. Import required libraries (except ``numpy`` and ``pandas``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave this, actually generally we do want to use double-backticks around pandas as it highlites it
That's not what we have been doing in a bunch of previous PRs, though. But, I would say we shouldn't convert all occurrences of " |
Noted. I'll update my PR to change this. |
I added ``pandas`` back into the docs where I think it makes sense based on context. Its kind of subjective, so I'd appreciate feedback on 5d9b334 and the remaining diffs in the PR. |
can you merge master and ping on green |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
closing as stale if you want to continue, pls open a new PR. |
See also: #32316
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
In #36845 the RST files were updated to normalize usage of the word "pandas". The following tokens were replaced:
In that PR, I wrongly said that I caught all patterns. I was wrong, and this PR address that (my apologies).
Misc Note
I'm also working on a rule for
code_checks.sh
to catch this in the future. I have the logic of the rule, but I'm struggling to get it to output nicely in such a way that it conforms with the rest of the rules incode_checks.sh
. I want to leave this information here in case someone has any ideas I can bounce of off, or in case anyone else wants to try their hand at this. I could be spinning my wheels there for awhile and don't want it to hold up getting these changes in.I used the following rule to find the remaining cases:
This finds easily identifiable formatting errors (``pandas``, for example), but it also respects article titles and code examples in an RST
code-block
s. It usesgrep -v
to get all text on a single line, but that causes error messages to lose the line number of the file that the error occurred on (everything in filefoo.rst
is reported to have happened on line 1). Because of this I'm not including the regex in this PR. If anyone is interested in giving me pointers on getting that bit fixed, or even taking my idea and running with it themselves, please do so.Edit:
Because its desired to retain ``pandas`` in some places where it contextually make sense, regex won't be able to capture such uses. The above regex can instead be:
which will ignore ``pandas`` but catch `pandas`